<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>生产派工单查询</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
</head>
<body>
<div style="color: #0e9aef">您正在做的业务是：生产管理--内部生产管理--生产查询</div>
<div style="margin-top: 20px;">符合条件的生产派工单总数：<span id="tot_count_span"></span>例</div>

<div class="container" style="margin-top: 20px">
    <form class="form-horizontal" id="send_ticket_form">
        <div class="form-group">
            <div class="col-md-5">
                <label class="control-label col-md-4">请输入派工单编号：</label>
                <div class="col-md-8">
                    <input type="text" name="search_id" id="search_id" class="form-control" />
                </div>
            </div>
            <div class="col-md-5">
                <label class="control-label col-md-4">请输入关键字：</label>
                <div class="col-md-8">
                    <input type="text" name="search_name" id="search_name" class="form-control" />
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-5">
                <label class="control-label col-md-4">请选择审核状态：</label>
                <div class="col-md-8">
                   <select class="form-control" name="search_state" id="search_state">
                       <option  value="">--请选择--</option>
                       <option  value="S001-0">等待</option>
                       <option  value="S001-1">通过</option>
                       <option  value="S001-2">未通过</option>
                   </select>
                </div>
            </div>
            <div class="col-md-5">
                <label class="control-label col-md-4">请输入登记时间：</label>
                <div class="col-md-4">
                    <input type="date" name="search_time1" id="search_time1" class="form-control" />
                </div>
                <div class="col-md-4">
                    <input type="date" name="search_time2" id="search_time2" class="form-control" />
                </div>
            </div>
            <div class="col-md-2">
                <input type="button" id="send_search_btn" value="查询" class="col-md-4 btn btn-default">
            </div>
        </div>
    </form>
</div>

<table style="margin-top: 10px" id="send_ticket_issue_table"></table>




<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>


<script>
    $(function (){

        setTimeout(function (){
            let num = $("#send_ticket_issue_table").bootstrapTable("getOptions").totalRows
            $("#tot_count_span").html(num)
        },500)

        $("#send_ticket_issue_table").bootstrapTable({
            method: "post",
            contentType: "application/x-www-form-urlencoded",
            url: "/manufacture/detail/selectAllManufactured",
            // 数据行交替样式
            striped: true,
            // 是否是服务器端分页：server表示服务器端，client表示前端分页
            sidePagination: 'server',
            //初始化加载第一页
            pageNumber: 1,
            //是否分页
            pagination: true,
            // 单页记录数，页大小
            pageSize: 5,
            // 分页列表
            pageList: [8, 10, 20],
            // 请求参数
            queryParams: function (params) {
                let obj = {
                    // params.limit获取组件中的页大小
                    // params.offset获取请求数据的起始索引
                    pageSize: params.limit,
                    pageNo: (params.offset / params.limit) + 1,

                    // 查询表单的数据
                    search_id:$("#send_ticket_form #search_id").val(),
                    search_name:$("#send_ticket_form #search_name").val(),
                    search_state:$("#send_ticket_form #search_state").val(),
                    search_time1:$("#send_ticket_form #search_time1").val(),
                    search_time2:$("#send_ticket_form #search_time2").val(),
                    }
                return obj;
            },
            // 表格列标题
            columns: [{
                title: "派工单编号",
                field: "manufactureId",
                formatter:function (value,row,index){
                    return `<a href="javascript:getId(${row.id})">${value}</a>`
                }
            }, {
                title: "产品编号",
                field: "productId",
            }, {
                title: "产品名称",
                field: "productName"
            },{
                title: "数量",
                field: "amount",

            },{
                title: "合格数量",
                field: "testedAmount"
            },{
                title: "生产状态",
                field: "manufactureProcedureTag",
                formatter:function (value, row, index){
                    if(value=="S002-0"){
                        return "等待"
                    }else if(value=="S002-1"){
                        return "生产中"
                    }else {
                        return "完成"
                    }
                }
            }]
        })

        $("#send_ticket_form #send_search_btn").click(function (){
            $("#send_ticket_issue_table").bootstrapTable("refresh")
        })
    })

    function getId(id){
        localStorage.setItem("qid",id)
        window.location="send_work_inquireByIdUI"
    }

</script>
</body>
</html>